package cn.javase.concurrent._并发编程._03_Java线程._线程常用API;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class _start与run {
    public static void main(String[] args) {
        Thread t = new Thread(() -> {
            log.info("start...");
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }, "t1");
        t.start(); // t.run()会阻塞,不会启动新的线程
        log.info("end...");
    }
}
